package com.example.myapplication2;

import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

public class DrawableActivity extends AppCompatActivity implements View.OnClickListener {
    View DrawableView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_drawable);
        findViewById(R.id.but1).setOnClickListener(this);
        findViewById(R.id.but2).setOnClickListener(this);
        DrawableView = findViewById(R.id.view);
        DrawableView.setBackgroundResource(R.drawable.ic_launcher_background);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.but1:
                DrawableView.setBackgroundResource(R.drawable.shape_over_rose);
                break;
            case R.id.but2:
                DrawableView.setBackgroundResource(R.drawable.shape_rect_gole);
                break;
        }
    }
}